#include "func.h"
#include"business.h"
#include "makeThread.h"
int main(int argc,char*argv[])
{
    // ./client 192.168.30.128 1234
    ARGS_CHECK(argc,3);
    int sockfd = socket(AF_INET,SOCK_STREAM,0);
    ERROR_CHECK(sockfd,-1,"socket");
    struct sockaddr_in addr;
    bzero(&addr,sizeof(addr));
    addr.sin_family = AF_INET;
    addr.sin_addr.s_addr = inet_addr(argv[1]);
    addr.sin_port = htons(atoi(argv[2]));
    int ret = connect(sockfd,(struct sockaddr*)&addr,sizeof(addr));
    ERROR_CHECK(ret,-1,"connect");
    

    // 处理业务
    clientbusiness(sockfd,argv[1],argv[2]);
    close(sockfd);
    return 0;
}
